<?php

require 'config.php';
$fromfolder = $_REQUEST["fromfolder"];
$filename = $_REQUEST["filename"];

if (empty($fromfolder) || empty($filename)) {
    echo "miss parame.";
    die;
}
$a_file = explode(",", $filename);
$dir_root = dirname(__FILE__);
$fromfolder = $dir_root . "/" . $fromfolder;
try {
    if (!empty($a_file)) {
        foreach ($a_file as $file) {
            if (is_file($fromfolder . "/" . $file)) {
                unlink($fromfolder . "/" . $file);
            }
        }
    }
} catch (Exception $e) {
    echo "error:" . DIRECTORY_SEPARATOR;
    die;
}
echo "success";
die;
?>